# 写程序，输入一个整数, 打印如下的四个三角形
# 如:
#     请输入: 3
# 1. 打印
#     *
#     **
#     ***
# 2. 打印
#       *
#      **
#     ***
# 3. 打印
#     ***
#     **
#     *
# 4. 打印
#     ***
#      **
#       *



n = int(input('请输入: '))


print('------- 1 --------')
# 1. 打印
for star in range(1, n+1):
    print('*' * star)
#     *
#     **
#     ***

print('------- 2 --------')
# 2. 打印
for star in range(1, n+1):
    # 方法2
    fmt = '%%%ds' % n  # '%3s'
    stars = '*' * star
    print(fmt % stars)
    # 方法1
    # 计算空格的个数
    # blank_count = n - star
    # blanks = ' ' * blank_count
    # stars = '*' * star
    # print(blanks + stars)

#       *
#      **
#     ***

print('------- 3 --------')
# 3. 打印
for star in range(n, 0, -1):
    print('*' * star)
#     ***
#     **
#     *

print('------- 4 --------')
# 4. 打印
for star in range(n, 0, -1):  # star 代表 ‘*’ 的个数
    fmt = '%%%ds' % n
    print(fmt % ('*' * star))
#     ***
#      **
#       *


